<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>layui</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="/SSM/js/layui/css/layui.css" media="all">
<script type="text/javascript" src="/SSM/js/jquery-2.2.1.min.js"></script>
<script type="text/javascript">
$(function(){
	$('a').click(function(){
		var pageNum=$(this).attr('name');
		$('#pageNum').val(pageNum);
		$('form').submit();
	});
});
</script>
<title>Insert title here</title>
</head>
<body>
	<a href="/SSM/user/addUser">新增</a>
	<form action="/SSM/user/userPage" method="post">
	<input type="text" name="nameSearch" value="${nameSearch }" placeholder="请输入编号/账号/姓名">
	<input type="submit" value="搜索">
	<input type="hidden" value="1" name="pageNum" id="pageNum">
	</form>
	<table class="layui-table">
		<colgroup>
			<col width="150">
			<col width="150">
			<col width="150">
			<col width="150">
			<col width="150">
			<col>
		</colgroup>
		<thead>
			<tr>
				<th>用户编号</th>
				<th>账号</th>
				<th>密码</th>
				<th>生日</th>
				<th>姓名</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${pageInfo.list }" var="user">
				<tr>
					<td>${user.id }</td>
					<td>${user.acc }</td>
					<td>${user.pwd }</td>
					<td><fmt:formatDate value="${user.birthday }"
							pattern="yyyy-MM-dd" /></td>
					<td>${user.name1 }</td>
					<td><a href="/SSM/user/updateDepart?id=${user.id }">修改</a> <a
						href="/SSM/user/deleteUser?id=${user.id }">删除</a></td>
				</tr>
			</c:forEach>
		</tbody>

		<tr>
			<td colspan="6" align="center">
			<a> 
			<span>每页显示${pageInfo.pageSize }条记录，当前第${pageInfo.pageNum }/${pageInfo.pages }</span>
			</a>
			<a href="javascript:void(0)"name="1">首页</a>
			<c:if test="${pageInfo.hasPreviousPage}">
			<a href="javascript:void(0)" name="${pageInfo.pageNum-1 }">上一页</a>
			</c:if>
			<c:if test="${pageInfo.hasPreviousPage==false}">
			<a>上一页</a>
			</c:if>
			
			<c:if test="${pageInfo.hasNextPage}">
			<a href="javascript:void(0)" name="${pageInfo.pageNum+1 }">下一页</a>
			</c:if>
			<c:if test="${pageInfo.hasNextPage==false}">
		<a>下一页</a>
			</c:if>
			<a href="javascript:void(0)" name="${pageInfo.pages }">末页</a>
			</td>
		</tr>

	</table>

</body>
</html>